var page = sm("do_Page");
var nf = sm("do_Notification");

var root=ui("$"); 
var do_ALayout_root=ui("do_ALayout_root");
var do_title=ui("do_title");

root.setMapping({
	"do_title.text":"title",
	"do_title.tag":"selected",
	"do_ALayout_root.tag":"id"
});

//订阅每次绑定数据后的事件
root.on("dataRefreshed", function(){
	var _selected= do_title.tag;
	var _id=do_ALayout_root.tag;
	switch (_id) {
	case "0":
		do_title.border="000000FF,1,[10,0,0,10]";	
		break;
	case "1":		
		do_title.border="OOOOO0FF,1,[0,10,10,0]";
		break;
	}
	switch (_selected) {
	case "0":
		do_title.fontColor="000000FF";
		do_title.bgColor="FFFFFFFF";		
		break;
	case "1":		
		do_title.fontColor="FFFFFFFF";
		do_title.bgColor="000000FF";
		break;
	}
});

//按下当前cell的时候，在当前页面中发出selectOneTab事件
do_ALayout_root.on("touch", function(){
	page.fire("selectOneTab", {title:do_title.text});
});